home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / wgdb-42.lha / wgdb-4.2 / readline / Makefile < prev    next >
Makefile  |  1992-09-11  |  4KB  |  163 lines

  1. ALL=all.internal
  2. host_alias = sun4
  3. host_cpu = sparc
  4. host_vendor = sun
  5. host_os = sunos4
  6. target_alias = sun4
  7. target_cpu = sparc
  8. target_vendor = sun
  9. target_os = sunos4
  10. subdir =
  11. unsubdir = .
  12. VPATH = .
  13. #                                   #
  14. # Makefile for readline and history libraries.               #
  15. #                                   #
  16.  
  17.  
  18. srcdir = .
  19. destdir = /usr/local
  20.  
  21. INSTALL_PROG = install -c
  22. INSTALL_FILE = $(INSTALL_PROG)
  23.  
  24. #### host and target dependent Makefile fragments come in here.
  25. ##
  26.  
  27. # Here is a rule for making .o files from .c files that doesn't force
  28. # the type of the machine (like -sun3) into the flags.
  29. .c.o:
  30.     $(CC) -c $(CFLAGS) $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) $<
  31.  
  32. # Destination installation directory.  The libraries are copied to DESTDIR
  33. # when you do a `make install', and the header files to INCDIR/readline/*.h.
  34. DESTDIR = $(destdir)/lib
  35. INCDIR = $(destdir)/include
  36.  
  37. # Define TYPES as -DVOID_SIGHANDLER if your operating system uses
  38. # a return type of "void" for signal handlers.
  39. TYPES = -DVOID_SIGHANDLER
  40.  
  41. # HP-UX compilation requires the BSD library.
  42. #LOCAL_LIBS = -lBSD
  43.  
  44. # Xenix compilation requires -ldir -lx
  45. #LOCAL_LIBS = -ldir -lx
  46.  
  47. # Comment out "-DVI_MODE" if you don't think that anyone will ever desire
  48. # the vi line editing mode and features.
  49. READLINE_DEFINES = $(TYPES) -DVI_MODE
  50.  
  51. DEBUG_FLAGS = -g
  52. LDFLAGS = $(DEBUG_FLAGS) 
  53. CFLAGS = $(DEBUG_FLAGS) $(SYSV) -I.
  54.  
  55. # A good alternative is gcc -traditional.
  56. #CC = gcc -traditional
  57. CC = cc
  58. RANLIB = /bin/ranlib
  59. AR = ar
  60. AR_FLAGS = clq
  61. RM = rm
  62. CP = cp
  63.  
  64. LOCAL_INCLUDES = -I$(srcdir)/../
  65.  
  66. CSOURCES = readline.c history.c funmap.c keymaps.c vi_mode.c \
  67.        emacs_keymap.c vi_keymap.c
  68.  
  69. HSOURCES = readline.h chardefs.h history.h keymaps.h
  70. SOURCES  = $(CSOURCES) $(HSOURCES)
  71.  
  72. DOCUMENTATION = readline.texinfo inc-readline.texinfo \
  73.         history.texinfo inc-history.texinfo
  74.  
  75. SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
  76.  
  77. THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
  78.  
  79. ##########################################################################
  80.  
  81. STAGESTUFF = *.o
  82.  
  83. all: libreadline.a
  84.  
  85. libreadline.a:    readline.o history.o funmap.o keymaps.o
  86.         $(RM) -f libreadline.a
  87.         $(AR) $(AR_FLAGS) libreadline.a readline.o history.o funmap.o keymaps.o
  88.         $(RANLIB) libreadline.a
  89.  
  90. readline.o:    readline.h chardefs.h  keymaps.h history.h readline.c vi_mode.c
  91. history.o:    history.c history.h
  92. funmap.o:    readline.h
  93. keymaps.o:    emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
  94.  
  95. libtest:    libreadline.a libtest.c
  96.         $(CC) -o libtest $(CFLAGS) $(CPPFLAGS) -L. libtest.c -lreadline -ltermcap
  97.  
  98. readline: readline.c history.o keymaps.o funmap.o readline.h chardefs.h
  99.     $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
  100.         $(LOCAL_INCLUDES) -DTEST -o readline readline.c funmap.o \
  101.          keymaps.o history.o -L. -ltermcap
  102.  
  103. readline.tar:    $(THINGS_TO_TAR)
  104.         tar -cf readline.tar $(THINGS_TO_TAR)
  105.  
  106. readline.tar.Z:    readline.tar
  107.         compress -f readline.tar
  108.  
  109. install:    $(DESTDIR)/libreadline.a includes
  110.  
  111. includes:
  112.         if [ ! -r $(INCDIR)/readline ]; then\
  113.          mkdir $(INCDIR)/readline;\
  114.          chmod a+r $(INCDIR)/readline;\
  115.         fi
  116.         $(INSTALL_FILE) $(srcdir)/readline.h $(INCDIR)/readline/
  117.         $(INSTALL_FILE) $(srcdir)/keymaps.h $(INCDIR)/readline/
  118.         $(INSTALL_FILE) $(srcdir)/chardefs.h $(INCDIR)/readline/
  119. clean:
  120.         rm -f $(STAGESTUFF) *.a *.log *.cp *.tp *.vr *.fn *.aux *.pg *.toc
  121.  
  122. $(DESTDIR)/libreadline.a: libreadline.a
  123.         -mv $(DESTDIR)/libreadline.a $(DESTDIR)/libreadline.old
  124.         $(INSTALL_PROG) libreadline.a $(DESTDIR)/libreadline.a
  125.         $(RANLIB) $(DESTDIR)/libreadline.a
  126.  
  127. # Copy the object files from a particular stage into a subdirectory.
  128. stage1: force
  129.     -mkdir stage1
  130.     -mv $(STAGESTUFF) stage1
  131.  
  132. stage2: force
  133.     -mkdir stage2
  134.     -mv $(STAGESTUFF) stage2
  135.  
  136. stage3: force
  137.     -mkdir stage3
  138.     -mv $(STAGESTUFF) stage3
  139.  
  140. against=stage2
  141.  
  142. comparison: force
  143.     for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
  144.  
  145. de-stage1: force
  146.     - (cd stage1 ; mv -f * ..)
  147.     - rmdir stage1
  148.  
  149. de-stage2: force
  150.     - (cd stage2 ; mv -f * ..)
  151.     - rmdir stage2
  152.  
  153. de-stage3: force
  154.     - (cd stage3 ; mv -f * ..)
  155.     - rmdir stage3
  156.  
  157. force:
  158.  
  159. # with the gnu make, this is done automatically.
  160.  
  161. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  162.     $(SHELL) ./config.status
  163.